#ifndef _TOOLS_H_
#define _TOOLS_H_

#include <string>
using namespace std;

// #define PATH_MAX	1024

typedef struct __MemoryStruct {
		size_t size;
		char* data;
} MemoryStruct;

class CTools {
	public:
		static void string_replace(string &strBig, const string &strSrc,
				const string &strDst);
		static long HttpDownloadSync(const char* pszUrl, const char* pszParam,
				MemoryStruct *chunk, char* pszLastURL, long *httpretcode);
		static void cancelDownload();
		static void InitDownload();

	private:
		static bool isCanceled;
		static size_t chunkdata_callback(void *ptr, size_t size, size_t nmemb,
				void *data);
};

#endif
